//
//  ViewController.m
//  10602B
//
//  Created by student on 16/3/2.
//  Copyright © 2016年 NIIT. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()
@property (weak, nonatomic) IBOutlet UIButton *btn1;
@property (weak, nonatomic) IBOutlet UILabel *label1;
@property (weak, nonatomic) IBOutlet UILabel *label2;

@property (weak, nonatomic) IBOutlet UILabel *label3;
@property (weak, nonatomic) IBOutlet UILabel *label4;
@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
-(void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
    if(toInterfaceOrientation==UIInterfaceOrientationLandscapeLeft||toInterfaceOrientation==UIInterfaceOrientationLandscapeRight)
    {
        self.btn1.frame=CGRectMake(37, 37, 300, 150);
        self.label1.frame=CGRectMake(350, 37, 100, 21);
        self.label2.frame=CGRectMake(350, 81, 100, 21);
        self.label3.frame=CGRectMake(350, 125, 100, 21);
        self.label4.frame=CGRectMake(350, 169, 100, 21);
    }
    else
    {
        self.btn1.frame=CGRectMake(37, 37, 300, 150);
        self.label1.frame=CGRectMake(37, 233, 100, 21);
        self.label2.frame=CGRectMake(237, 233, 100, 21);
        self.label3.frame=CGRectMake(37, 286, 100, 21);
        self.label4.frame=CGRectMake(237, 286, 100, 21);
    }
}
@end
